package com.github.tangmonkmeat;

import java.util.Scanner;

/**
 * Description:
 *
 * @author zwl
 * @version 1.0
 * @date 2021/8/5 上午10:52
 */
public class 最大公约数和最小公倍数的差值最大 {

    public static void main(String[] args){
        try(Scanner sc = new Scanner(System.in)){
            long n = sc.nextInt();
            long a = n;
            long b = n - 1;
            long c = getMaxGY(a,b);
            System.out.println(getMaxGB(a,b,c) - c);
        }
    }

    public static long getMaxGY(long a,long b){
        if(a < b){
            long t = a;
            a = b;
            b = t;
        }
        while(b > 0){
            long yu = a % b;
            a = b;
            b = yu;
        }
        return a;
    }

    public static long getMaxGB(long a,long b,long c){
        return a * b / c;
    }
}
